<template>
  <div class="login">
    <div class="login-wrapper">
      <h2>登录后台</h2>
      <div class="wrap">
        <el-input v-model="username" placeholder="请输入内容" prefix-icon='el-icon-user'></el-input>
        <el-input v-model="password" placeholder="请输入密码" prefix-icon='el-icon-lock'></el-input>
        <el-button type="primary" plain @click="login">提交</el-button>
      </div>
    

    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username:'admin',
      password:'123'
    }
  },
  methods:{
     login(){
       if(this.username=='admin'&&this.password=='123'){
         this.$router.push({path:'/home',query:{username:this.username}})
       }else{
         this.messsage.error('账号或密码错误')
       }
     }
  }
}
</script>

<style>
  *{
    margin: 0;
    padding: 0;
  }
  .login{
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .login-wrapper{
    width: 300px;
    height: 260px;
    box-shadow: 0 0 5px #999;
    text-align: center;
    border-radius: 5px;
  }
  .wrap{
    padding: 10px 50px;
  }
  input{
    margin: 10px;
  }
</style>